package com.hksj.cbm.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author zengke
 * @version 1.0
 * @see DeviceCategory
 * @since 2024/08/28 11:48
 */

@Data
@TableName(value = "hk_device_category")
public class DeviceCategory {

    /**
     * 设备分类代码
     */
    @ApiModelProperty(value = "设备分类代码")
    @TableId(value = "code",type = IdType.INPUT)
    private String code;

    /**
     * 设备分类父节点代码
     */
    @ApiModelProperty(value = "设备分类父节点代码")
    @TableField(value = "parent_code")
    private String parentCode;

    /**
     * 设备分类名称
     */
    @ApiModelProperty(value = "设备分类名称")
    @TableField(value = "`name`")
    private String name;

    /**
     * 设备分类描述
     */
    @ApiModelProperty(value = "设备分类描述")
    @TableField(value = "remark")
    private String remark;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date updateTime;

    /**
     * 子节点
     */
    @ApiModelProperty(value = "子节点")
    @TableField(exist = false)
    private List<DeviceCategory> children = new ArrayList<>();
}
